import { createApp } from 'vue'
import './tailwind.css';
import '@/assets/iconfont/iconfont.css';
import App from './App.vue'

// 引入路由
import router from './router'
// 引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css' // 引入默认的主题样式
import 'element-plus/theme-chalk/dark/css-vars.css' // 引入深色主题
// 引入element-plus Icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 中文
import zhCn from 'element-plus/es/locale/lang/zh-cn';
// 修改分页器默认文字
zhCn.el.pagination.total = '共 {total} 条';
zhCn.el.pagination.pagesize = '条/页';

// 引入pinia
import pinia from '@/stores/index.js';

const app = createApp(App)

// 注册element-plus
app.use(ElementPlus, {
  locale: zhCn
})
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册pinia
app.use(pinia)

// 注册路由
app.use(router);

// 屏蔽警告信息
app.config.warnHandler = () => null;
app.mount('#app')